package com.yuliang.controller;


import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class UserController {

    @RequestMapping("/save")
    @ResponseBody
    public String save(){
        System.out.println("user save");
        return "{'info':'springmvc'}";
    }

    @RequestMapping("/demo1")
    @ResponseBody
    public String demo1(String name){
        System.out.println("hello "+name);
        return "{'info':'springmvc'}";
    }

    @RequestMapping("/demo2")
    @ResponseBody
    public String demo2(String name,int age){
        System.out.println("hello "+name+" age = "+age+"幸福");
        return "{'info':'springmvc'}";
    }
}
